package vsvm.gui.forms;

import java.awt.BorderLayout;

import javax.swing.JScrollPane;
import javax.swing.JTextPane;

import vsvm.data.source.AbstractDataSource;
import vsvm.gui.VSVMInternalFrame;

public class RawDataFrame extends VSVMInternalFrame {
	private AbstractDataSource s;
	
	public RawDataFrame(String title, AbstractDataSource src) {
		super(title);
		s = src;	
		initialize();
	}
	
	private void initialize() {
		JTextPane p = new JTextPane();
		p.setEditable(false);
		JScrollPane scr = new JScrollPane(p);
		this.setLayout(new BorderLayout());
		this.add(scr, BorderLayout.CENTER);
		
		if (s.open()) {
			p.setText(s.getRawData());
			s.close();
		}
	}

}
